﻿#include <iostream>
using namespace std;

double power(double x, int n) {
	double y = 1;

	for (int i = 0; i < n; i++) {
		y *= x;
	}

	return y;
}

int main() {

	double a;
	int b;

	cout << "计算实数a的b次方值\n";

	cout << "实数a：";
	cin >> a;

	cout << "次数b：";
	cin >> b;

	cout << a << "的" << b << "次方为：" << power(a, b) << endl;

	cin.get();
	cin.get();
}